package cn.smbms.dao;

import java.sql.Connection;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import cn.smbms.pojo.Bill;
import cn.smbms.pojo.User;

@Repository("billMapper")
public interface BillMapper {
	/**
	 * 通过billId获取Bill
	 * 
	 * @param id
	 * @return
	 */
	public Bill getBillById(@Param("id")Integer id);

	/**
	 * 增加订单
	 * 
	 * @param connection
	 * @param bill
	 * @return
	 * @throws Exception
	 */
	public int add(Bill bill) throws Exception;
	
	/**
	 * 根据userCode查询出User
	 * @param userCode
	 * @return
	 */
	public Bill selectBillCodeExist(String billCode);

	/**
	 * 通过查询条件获取供应商列表-模糊查询-getBillList
	 * 
	 * @param connection
	 * @param bill
	 * @return
	 * @throws Exception
	 */
	/* public List<Bill> getBillList(Bill bill)throws Exception; */
	public List<Bill> getBillList(@Param("productName") String productName, @Param("providerId") Integer providerId,
			@Param("isPayment") Integer isPayment, @Param("from") Integer currentPageNo,
			@Param("pageSize") Integer pageSize) throws Exception;

	/**
	 * 根据条件查询用户表记录数
	 * 
	 * @param queryUserName
	 * @param queryUserRole
	 * @return
	 */
	public int getBillCount(@Param("productName") String productName, @Param("providerId") Integer providerId,
			@Param("isPayment") Integer isPayment);

	/**
	 * 通过delId删除Bill
	 * 
	 * @param connection
	 * @param delId
	 * @return
	 * @throws Exception
	 */
	public int deleteBillById(String delId) throws Exception;
 

	/**
	 * 修改订单信息
	 * 
	 * @param connection
	 * @param bill
	 * @return
	 * @throws Exception
	 */
	public int modify(Bill bill) throws Exception;

	/**
	 * 根据供应商ID查询订单数量
	 * 
	 * @param connection
	 * @param providerId
	 * @return
	 * @throws Exception
	 */
	public int getBillCountByProviderId(String providerId) throws Exception;

	 

}
